namespace array_demo.Model.Queue
{
    public class LinkedQueue<E> : IQueue<E>
    {
        private LinkedList1<E> linkedList1;

        public LinkedQueue()
        {
            linkedList1 = new LinkedList1<E>();
        }

        public int Count => linkedList1.count;

        public bool IsEmpty => linkedList1.isEmpty;

        public E Dequeue()
        {
            return linkedList1.deleteFirst();
        }

        public void Enqueue(E e)
        {
            linkedList1.AddLast(e);
        }

        public E Peek()
        {
            return linkedList1.GetFirst();
        }

        public override string ToString()
        {
            return "queue" + linkedList1.ToString() + "top";
        }
    }
}